<template>
	<view class="indexBig">
		<view class="top" @click="goToPage('allOrder')">
			<u-icon name="arrow-down" size="36"></u-icon>
			<text>下单成功</text>
		</view>
		<view class="info">
      <u-icon name="checkmark-circle-fill" size="120" color="#7CACF1"></u-icon>
			<view class="">恭喜您下单成功</view>
		</view>
		<view class="shopCarList">
			<view class="title">商品清单：</view>
			<view class="list" v-for="(item,index) in shopCarList" :key="index">
				<view class="">
					{{item.foodsName}}
					<template v-if="item.foodsSpecificationName">
						(
						<text v-for="(specItem,specIndex) in item.foodsSpecificationName.split(',')" :key="specIndex">
							{{specItem}}
							<text v-if="specIndex!=item.foodsSpecificationName.split(',').length-1">,</text>
						</text>
						)
					</template>
					<text style="margin-left: 10rpx;">X {{item.foodNum}}</text>
				</view>
			</view>
			<u-empty text="请添加商品" mode="page" v-if="shopCarList.length == 0"></u-empty>
		</view>
	</view>
</template>

<script>
	import CommenHeader from '@/components/header/header.vue'
	export default {
		components: {
			CommenHeader
		},
		data() {
			return {
				shopCarList: []
			}
		},
		onShow() {
			this.shopCarList = uni.getStorageSync('companyShopCarList');
		},
		methods: {
			goToPage(type) {
				let url;
				switch (type) {
					case "allOrder":
						url = '/pages/order';
						break;
				}
				uni.redirectTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.indexBig {
		min-height: 100vh;
		background: linear-gradient(0.45deg, #F5F5F5 6.52%, #FF8739 58.65%, #FB690F 98.93%);
		background-size: 100vw 466rpx;
		background-repeat: no-repeat;
		background-color: #f5f5f5;
		padding: 40rpx 20rpx;
		padding-bottom: 150rpx;

		.top {
			position: relative;

			image {
				width: 40rpx;
				height: 40rpx;
				transform: rotate(90deg);
			}

			text {
				color: #fff;
				width: 100%;
				position: absolute;
				left: 0;
				top: 0;
				text-align: center;
				font-size: 32rpx;
				font-weight: bold;
			}
		}

		.info {
			padding: 80rpx 20rpx;
			margin: 40rpx 0;
			background-color: #fff;
			border-radius: 20rpx;
			@include flexs();
			flex-direction: column;
			font-size: 32rpx;
			line-height: 2;

			image {
				width: 120rpx;
				height: 120rpx;
				margin: 0 auto 30rpx auto;
			}

			>view:nth-child(3) {
				font-size: 28rpx;
				color: rgba(0, 0, 0, 0.55);
			}
		}
	}

	.shopCarList {
		width: 100%;
		background-color: #fff;
		margin: 40rpx 0;
		border-radius: 20rpx;
		padding: 20rpx;

		.title {
			margin-bottom: 20rpx;
			font-size: 32rpx;
		}

		.list {
			border-bottom: 1px solid #eee;
			padding: 20rpx 0;
			display: flex;
			justify-content: space-between;
			align-items: center;

			view:nth-child(1) {
				line-height: 2;
				font-size: 28rpx;
			}

			>view:nth-child(2) {
				width: 20%;
				@include flexs(center, center);
				color: #00000080;
				border-radius: 50rpx;
				border: 1px solid #eee;

				svg {
					margin: 0 10rpx;
				}

				view {
					width: 50rpx;
					height: 50rpx;
					text-align: center;
					line-height: 50rpx;
				}
			}

			&:last-child {
				border-bottom: 0;
			}
		}
	}
</style>